const querystring = require('querystring');
/*
* 基础的插件写法*/
/*
module.exports=function(req,res,next){
    var str='';
    req.on('data',function(data){
        str+=data;
    })
    req.on('end',function(){
        req.body=querystring.parse(str);
        next();
    })

}*/
/*升级的写法*/
/*module.exports=function(){
    return function(req,res,next){
        var str='';
        req.on('data',function(data){
            str+=data;
        })
        req.on('end',function(){
            req.body=querystring.parse(str);
            next();
        })
    }
}*/
/*写法继续升级*/
module.exports = {
    aaa: function () {
        return function (req, res, next) {
            var str = '';
            req.on('data', function (data) {
                str += data;
            })
            req.on('end', function () {
                req.body = querystring.parse(str);
                next();
            })
        }
    }
}

